#!/usr/bin/env python

class Error1(Exception):
    pass

class Error2(Error1):
    pass

class Error3(Error2):
    pass

try:
    raise Error3, "Testing"
except Error1, value:
    print "Caught:", value
